//========= Program Description ==========
//name : Maze View
//propose : show maze
//Written by Akkz
//========================================

import java.awt.*;
import javax.swing.*;

public class MazeView extends JFrame
{
	Maze maze;
	
	public MazeView()
	{
		maze = new Maze();

		setLayout(new GridLayout(8, 7));
		setVisible(true);
		
		for(int[] row : maze.Maze)
		{
			for(int i : row)
			{
				JPanel newPanel = new JPanel();
				
				if ( i == 2 )
					newPanel.setBackground(Color.black);
				else
					newPanel.setBackground(Color.white);
				
				add(newPanel);
			}
		}
		
		setTitle("maze");
		setSize(700, 600);
		setLocation(300, 200);
	}
	
	public static void main(String[] args)
	{
		new MazeView();
	}
}
